<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>TZ-追梦</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        #box{
            height: 300px;
            border: 1px solid blue;
        }
        #box div{
            width:100px;
            height: 20px;
            margin: 100px auto;
            box-shadow: 0 0 3px #000;
            border-radius: 10px;

            background: -webkit-repeating-linear-gradient(
                    30deg,#990066 0,
                    #9933ff 10px ,
                    #ff0033 10px,
                    #00cc00 20px
            );
            transition: 3s linear;
        }
        #box:hover div{
            width: 200px;
            background-position: -400px 0px;
        }
    </style>
</head>
<body>
    <div id="box">
        <div></div>
    </div>

</body>
</html>